package com.example.xiaodong.cn.dajiqi.data;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by 董豪华 on 2017/4/19.
 */

public class Gongutils {
    private static double      currentTime = 0, oldTime = 0;

    /**
     *
     * @return 返回实时时间
     */
    public static String getTime() {
        currentTime = System.currentTimeMillis();
        SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
        Date curDate = new Date();
        String str = format.format(curDate);
        if (currentTime - oldTime >= 5 * 60 * 1000) {
            oldTime = currentTime;
            return str;
        } else {
            return "";
        }

    }
}
